﻿using System;
using System.ComponentModel;
using System.Linq;
using ProjectEuler.Linq;

namespace ProjectEuler.Problems
{
    [EulerProblem(41, 7652413L)]
    [Description("What is the largest n-digit pandigital prime that exists?")]
    internal sealed class Problem041 : EulerProblem
    {
        public override Object Solve()
        {
            return (from c in (2).To(7)
                    from n in Integers.PandigitalNumbers(c)
                    where n.IsPrime()
                    select n).Max();
        }
    }
}
